package com.zzl.alligator.management.system.service.impl;


import com.zzl.alligator.management.system.mapper.SysLoginRecordMapper;
import com.zzl.alligator.management.system.domain.SysLoginRecord;
import com.zzl.alligator.management.system.service.ISysLoginRecordService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * 系统访问记录(SysLoginRecord)服务层
 *
 * @author zhouziliang
 * @since 2020-07-07
 */
@Service
public class SysLoginRecordService implements ISysLoginRecordService {
    
    @Autowired
    private SysLoginRecordMapper sysLoginRecordMapper;
    
    /**
     * 通过ID查询单条数据
     *
     * @param recordId 主键
     * @return 实例对象
     */
    @Override
    public SysLoginRecord findSysLoginRecordById(Long recordId) {
        return sysLoginRecordMapper.findSysLoginRecordById(recordId);
    }

   /**
     * 通过实体作为筛选条件查询
     *
     * @param sysLoginRecord 实例对象
     * @return 对象列表
     */
    @Override
    public List<SysLoginRecord> findSysLoginRecordList(SysLoginRecord sysLoginRecord) {
        return sysLoginRecordMapper.findSysLoginRecordList(sysLoginRecord);
    }

    /**
     * 新增数据
     *
     * @param sysLoginRecord 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSysLoginRecord(SysLoginRecord sysLoginRecord) {
        return sysLoginRecordMapper.insertSysLoginRecord(sysLoginRecord);
    }

    /**
     * 修改数据
     *
     * @param sysLoginRecord 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateSysLoginRecord(SysLoginRecord sysLoginRecord) {
        return sysLoginRecordMapper.updateSysLoginRecord(sysLoginRecord);
    }

    /**
     * 通过主键删除数据
     *
     * @param recordId 主键
     * @return 是否成功
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteById(Long recordId) {
        return sysLoginRecordMapper.deleteById(recordId);
    }

    /**
     * 清空记录
     *
     * @return 结果
     */
    @Override
    public int clean() {
        return sysLoginRecordMapper.clean();
    }
}